<!DOCTYPE html>
<html>
	<head>
		<title>pool stat</title>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<!-- Latest compiled and minified CSS -->
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
		<!-- Optional theme -->
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">

	</head>
	<body>
		<div class="container-fluid">
			<div class="row">
				<div class="col-sm-12 col-md-12 main">
					<div class="table-responsive">
						<table class="table table-striped">
							<tbody>
<?php
if (!empty($poolstats) AND is_array($poolstats)){
?>
								<tr>
									<th colspan='6'>Pool stats</th>
								</tr>
<?php
	foreach ($poolstats as $k => $v) {
?>
								<tr>
									<td colspan='3'><?php echo $k ?></td><td colspan='3'><?php echo $v ?></td>
								</tr>
<?php
	}
}
?>
<?php
if (!empty($account) AND is_array($account)){
?>
								<tr>
									<th colspan='6'>Account balance</th>
								</tr>
<?php
	foreach ($account as $k => $v) {
?>
								<tr>
									<td colspan='3'><?php echo $k ?></td><td colspan='3'><?php echo $v ?></td>
								</tr>
<?php
	}
}
?>
<?php
if (!empty($hashrate) AND is_array($hashrate)){
?>
								<tr>
									<th colspan='6'>Hash Rate</th>
								</tr>
<?php
	foreach ($hashrate as $k => $v) {
?>
								<tr>
									<td colspan='3'><?php echo $k ?></td><td colspan='3'><?php echo $v ?></td>
								</tr>
<?php
	}
}
?>

<?php
if (!empty($paymentHistory) AND is_array($paymentHistory)){
?>
								<tr>
									<th colspan='6'>Payment History</th>
								</tr>
<?php
	foreach ($paymentHistory['rows'] as $key=>$val) {
?>
								<tr>
									<td><?php echo $key ?></td>
<?php
		foreach((array)$val as $k => $v) {
			if ($k == 'timestamp'){
				$v = strtotime($v);
				$v = date('Y-m-d H:i:s',$v+3600*3);
			}
?>
									<td><?php echo $v ?></td>

<?php
		}
?>
								</tr>
<?php
	}
}
?>


<?php
if (!empty($workers) AND is_array($workers)){
?>
								<tr>
									<th colspan='6'>Workers' Hash Rate</th>
								</tr>
<?php
	foreach ($workers['rows'] as $key=>$val) {
?>
								<tr>
									<td colspan='2'><?php echo $val->worker ?></td>
									<td colspan='4'>
<?php
		foreach((array)$val as $k => $v) {
?>
									<?php echo $v ?><br>
<?php
		}
?>
									</td>
								</tr>
<?php
	}
}
?>
<!--
<div class="progress">
  <div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;">
    60%
  </div>
</div>
-->
							</tbody>
						</table>
					</div>

				</div>
			</div>
		</div>
		<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
		<!-- Latest compiled and minified JavaScript -->
		<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
	</body>
</html>
